<template>
	<view>
		<view class='gotop' :class="scrollTop>800?'show':''"  @click="gotop">
			<view class="setshut iconfont icon-jiantou-shang"></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			// 头部距离
			scrollTop: {
				type: Number,
				value: 0
			},
		},
		data() {
			return {
			};
		},
		methods: {
			gotop:function(){
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				})
			}, 
		}
	}
</script>

<style scoped>
.gotop {
    position: fixed;
    right: 50rpx;
    width: 70rpx;
    height: 70rpx;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 35rpx;
    z-index: 50;
    bottom: -70rpx;
	opacity: 0;
	transition: all 0.3s;
    text-align: center;
	
}
.gotop.show{
	opacity: 1;
    bottom: 16vh;
}
.gotop .setshut {
    display: inline-block;
    color: #fff;
    font-size: 40rpx;
    line-height: 70rpx;
}
</style>
